<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Timemanagement</title>
<link rel="stylesheet" href="style.css">
<?php session_start();

 if(isset($_POST['username'])){
@ $user = $_POST['username'];
@ $pwd = $_POST['password'];

if ($user == "mg" && $pwd=="mg") {
		$_SESSION['IsLoggedIn'] = true;
		$_SESSION['user']=$_POST['username'];
		echo 'Sie sind nun eingeloggt!';
		setcookie("Timemanagement", "Timemangement Projekt");
		setcookie("TimemanagementLogin", $user, time()+3600); 
	}

if(!isset($_SESSION['IsLoggedIn']) || !$_SESSION['IsLoggedIn']){
		echo 'Username oder Passwort falsch!';
	}
}
 ?>
</head>

<body>
<h3>Login</h3>
<div class=wrapper>
<form action="login.php" name="login" id="login" method="post">

<label for="username">Username:</label><input type="text" name="username" id="username" size="20"  /> </br>
<label for="password">Passwort:</label><input type="password" size="20" name="login" id="login" /> </br>
<input type ="submit" id="username">
</form>
</div>
</body>
</html>